package io.wdb.common.utils;

public class PageHelperUtil {
	public static int getPageNum(Query query) {
		if(query.get("page")==null||"".equals(query.get("page"))) {
			return 1;
		}else{
			try {
				return Integer.valueOf(query.get("page").toString());
			} catch (Exception e) {
				return 1;
			}
		}
	}
	public static int getPageSize(Query query) {
		if(query.get("limit")==null||"".equals(query.get("limit"))) {
			return 10;
		}else{
			try {
				return Integer.valueOf(query.get("limit").toString());
			} catch (Exception e) {
				return 10;
			}
		}
	}
}
